-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rebinding imports #2312
Fix rebinding imports #2312
Conversation
8772968
to
62f5051
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import resolution needs to happen during early name resolution and macro expansion, so not within the "late" name resolver that is rust-ast-resolve-item.cc
. At the moment the system is a bit of a mess and we are working on reimplementing our name resolution from scratch - I'll send the first PR soon, and it'd be great to have your contributions on it :)
4785b56
to
e7c6e69
Compare
@powerboat9 are you interested in updating/rebasing this PR? I think it would still be worth it to have rebinding imports fixed for the existing name resolution algorithm, since NR 2.0 is taking longer than I planned (due to me not having time to work on it at all, sorry about that) |
gcc/rust/ChangeLog: * resolve/rust-ast-resolve-item.cc (flatten_glob): Use Import class. (flatten_rebind): Likewise. (flatten_list): Likewise. (flatten): Likewise. (flatten_use_dec_to_paths): Likewise. (flatten_use_dec_to_imports): Likewise. (ResolveItem::visit): Likewise. (Import::add_prefix): New. (rust_flatten_nested_glob): Adjust test. (rust_flatten_glob): Likewise. (rust_flatten_rebind_none): Likewise. (rust_flatten_rebind): Likewise. (rust_flatten_rebind_nested): Likewise. (rust_flatten_list): Likewise. * resolve/rust-ast-resolve-item.h (class Import): New. gcc/testsuite/ChangeLog: * rust/compile/use_2.rs: New test. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
e7c6e69
to
475715c
Compare
Did a quick rebase, this should work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks :)
This fixes rebinding imports, and should also get us closer to working glob imports.